<%@ page language="java" contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" href="all.css" type="text/css" media="screen" />
    <script src="jquery-1.7.2.min.js"></script>
    <script src="login.js"></script>
    <script src="edit.js"></script>
    <script src="enter.js"></script>
<title>留言板 - <c:out value="${leagueBean.name}" /></title>

<script type="text/javascript">

window.onload=function(){
	rightH=document.getElementById("liuyan_right").offsetHeight;
	if(rightH<600){
	document.getElementById("liuyan_left").style.height=600+"px";}
	else{
		document.getElementById("liuyan_left").style.height=rightH+"px";
	}
	select();
}
</script>



</head>

<body>
<div id="main">
 <div id="header">
       <div id="header_inner">
          <div id="header_inner_top">
          <div id="container">
             <jsp:include page="./head.jsp" flush="true"/>
        </div>
        </div>
	</div>
    </div>
	<div id="liuyan_body">
    	<div id="liuyan_left">
        	<div id="liuyan_left_left">
        		<div id="left_logo">
               		<a class="left_a" href="http://herald.seu.edu.cn" >
                 	
              		 </a>  
            	</div>
                <div id="left_platform">
               		<a class="left_a" href="http://herald.seu.edu.cn/league_p/" >
                 
              		 </a>  
            	</div>
                <div id="left_home">
               		<a class="left_a" href="home.jsp?league=<%=request.getParameter("league") %>" >
                
              		 </a>  
            	</div>
                <div id="liuyan_left_information">
               		<a class="left_a" href="activities.jsp?league=<%=request.getParameter("league") %>" >
                
              		 </a>  
            	</div>
                <div id="left_album">
               		<a class="left_a" href="albums.jsp?league=<%=request.getParameter("league") %>" >
               
              		 </a>  
            	</div>
                <div id="left_recruiting">
               		<a class="left_a" href="recruit.jsp?league=<%=request.getParameter("league") %>" >
               
              		 </a>  
            	</div>
                <div id="left_polling">
               		<a class="left_a"  href="polling.jsp?league=<%=request.getParameter("league") %>" >
               
              		 </a>  
            	</div>
                <div id="liuyan_left_guestbook">
               		<a class="left_a" href="javascript:void(0)" >
                 	
                
              		 </a>  
            	</div>
    
             </div>
             <div id="liuyan_left_right">
             </div>
         </div>
         <div id="liuyan_right">
         	<div id="right_title_kuangjia">
         	<div id="right_title">
                <div id="right_title_name">
                   <p><c:out value="${leagueBean.name}" /></p>
                </div>
                <!--未登录  -->
                <c:if test="${leagueUserAuth == null&&commonUserAuth == null}">
                <div id="right_title_attention">
                	<div id="right_title_attention_plus">
                    </div>
                    <div id="right_title_attention_text">
                    <form id="attentionAddForm" action="./AttentionAdd">
                    <input name="league" type="hidden" value=<%=request.getParameter("league") %> />
                    <input name="url" type="hidden" id="url" value="" />
                    </form>
                        <a title="加关注" href="javascript:void(0)" onclick="javascript:alert('您好，请您先登录。')">加关注</a>
                    </div>
                </div>
                </c:if>
               <!--未加关注  -->
                <c:if test="${attention == false && leagueUserAuth == null && commonUserAuth != null}">
                <div id="right_title_attention">
                	
                    <div id="right_title_attention_text">
                    <form id="attentionAddForm" action="./AttentionAdd" onsubmit="return false;">
                    <input name="league" type="hidden" value=<%=request.getParameter("league") %> />
                    <input name="url" type="hidden" id="url" value="" />
                    </form>
                    
                        <a id="att" style="display:block" title="加关注&nbsp;&nbsp;" href="javascript:void(0)" onclick="javascript:attention(<%=request.getParameter("league") %>);"><div id="right_title_attention_plus">
                    </div>加关注</a>
                        <a id="cancleAtt" style="display:none" title="取消关注" href="javascript:void(0)" onclick="javascript:cancleAttention(<%=request.getParameter("league") %>);">取消关注</a>
                    </div>
                </div>
                </c:if>
                
                <!--已加关注-->
                <c:if test="${attention == true}">
                <div id="right_title_attention">
                    <div id="right_title_attention_text">
                    <form id="attentionDeleteForm" action="./AttentionDelete">
                    <input name="league" type="hidden" value=<%=request.getParameter("league") %> />
                    <input name="url" type="hidden" id="url" value="" />
                    </form>
                    <a id="att" style="display:none" title="加关注&nbsp;&nbsp;" href="javascript:void(0)" onclick="javascript:attention(<%=request.getParameter("league") %>);"><div id="right_title_attention_plus">
                    </div>加关注</a>
                    <a id="cancleAtt" style="display:block" title="取消关注" href="javascript:void(0)" onclick="javascript:cancleAttention(<%=request.getParameter("league") %>);">取消关注</a>
                    </div>
                </div>
                </c:if>
                
            </div>
            </div>
            <div id="right_liuyan_kj">
            <div id="right_liuyan">
            	<div id="right_liuyan_title">
                </div>
                <div id="right_liuyan_line_kj">
                <div id="right_liuyan_line">
                </div>
                </div>
                <c:forEach items="${messages}" var="message" varStatus="varStatus">
                <div class="right_liouyan_liuyan1_kj">
                <div class="right_liuyan_liuyan1">
                	<div class="right_liuyan_liuyan1_photo" style="background-image:url(images/shetuanzhaoxin_31.png)">
                    </div>
                    <div class="right_liuyan_liuyan1_text_kj">
                    <div class="right_liuyan_liuyan1_text">
                    	<div class="right_liuyan_liuyan1_text_title">
                        	<div class="right_liuyan_liuyan1_text_title_line">
                            </div>
                            <div class="right_liuyan_liuyan1_text_title_infor">
                                <div class="right_liuyan_liuyan1_text_title_infor_name_kj">
                            	<div class="right_liuyan_liuyan1_text_title_infor_name">
                                	<p><c:out value="${message.entity.name}" /></p>
                                </div>
                                </div>
                                <div class="right_liuyan_liuyan1_text_title_infor_time_kj">
                                <div class="right_liuyan_liuyan1_text_title_infor_time">
                                	<p><c:out value="${message.entity.date}" /></p>
                                </div>
                                </div>
                                <div class="right_liuyan_liuyan1_text_title_infor_lou_kj">
                                <div class="right_liuyan_liuyan1_text_title_infor_lou">
                                	<p><c:out value="${varStatus.count}" />楼</p>
                                </div>
                                </div>
                                <div class="right_liuyan_liuyan1_text_title_infor_liuyandel">
                                 <c:if test="${leagueUserAuth != null && param.league != null && leagueUserAuth.leagueId == param.league || (commonUserAuth != null && commonUserAuth.userId == message.entity.userId)}">
                                <a href="javascript:void(0)" onclick="javascript:showDivDelete(<c:out value="${message.link}"/>)">删除</a>
                                </c:if>
                                </div>
                            </div>
                            <div class="right_liuyan_liuyan1_text_title_line">
                            </div>
                        </div>
                        <div class="right_liuyan_liuyan1_text_wenzi">
                        	<p><c:out value="${message.entity.content}" /></p>
                        </div>
                    </div>
                    </div>
                </div>
                </div>
                </c:forEach>
                
                <c:choose>
	            <c:when test="${leagueUserAuth != null || commonUserAuth != null}">
                <div id="right_write">
                    <div id="right_write_title_kj">
                	<div id="right_write_title">
                       <p>我来说两句...</p>
                    </div>
                    </div>
                    <div id="right_write_line_kj">
                    <div id="right_write_line">
                    </div>
                    </div>
                    <form id="addRemark" action="./MessagePost" method="post">
                    <div id="right_write_form_kj">
                    <div id="right_write_form">
                    
                     <textarea name="content" id="right_write_form_body"></textarea>
                     <input type="hidden" name="leagueId" value=<%=request.getParameter("league") %> />
                     <input type="hidden" name="leagueBookId" value=<%=request.getParameter("league") %> />
                    </div>
                    </div>
                    <div id="right_write_fabu_kj">
                    <div id="right_write_fabu">
                    	<a id="right_write_fabu_lj" href="javascript:void(0)" onclick="submitForm('right_write_form_body','addRemark');">
                        </a>
                    </div>
                    </div>
                    </form>
                </div>
                </c:when>
                <c:otherwise>
                <p style="height:21px;width:128px;float:left;font-size:16px;padding:8px;color:#3A3A3A;font-family:'微软雅黑'；">登录后即可留言。</p>
                </c:otherwise>
                </c:choose>
            </div>
            </div>
         </div>
         <div class="clear">
	     </div>
     </div>
     
     <div id="popDivDel" class="mydiv" style="display:none;">
确定删除留言？
<form  action="./MessageDelete" method="post" >
    <input type="hidden" name="league" value=<%=request.getParameter("league") %> />
    <input id="del_item_id" type="hidden" name="message" value="0" />
    <input type="submit" value="确定" name="submit" />
    <a href="javascript:closeDivDelete()">取消</a>
</form>
</div>
<div id="bg" class="bg" style="display:none;"></div> 
          
<jsp:include page="./footer.jsp" flush="true"/> 
</div>
</body>
</html>